package com.mall.order.controller;

import com.mall.order.entity.OrderEntity;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RabbitController {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @GetMapping("sendmq")
    public String sendMQ(){
        rabbitTemplate.convertAndSend("hello-exchange","hello.#",new OrderEntity());
        return "SUCCESS";
    }
}
